package cn.edu.sdjzu.xg23.kcsj01_backend.mapper;



import cn.edu.sdjzu.xg23.kcsj01_backend.entity.Employee;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface EmployeeMapper {
    @Insert("INSERT INTO employee(id,phoneNumber,email,name,department_id,user_id) VALUES (#{id},#{phoneNumber},#{email},#{name},#{department.id},#{user.id})")
    boolean addEmployee(Employee employee);
    @Select("SELECT * FROM employee WHERE id = #{id}")
    Employee getEmployeeById(Long id);

    // 查询所有员工(附条件查询)
    List<Employee> get(Employee employee);


    boolean save(Employee employee);

    boolean update(Employee employee);

    boolean delete(Long id);
}
